﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shell
{
    class Program
    {
        static void Main(string[] args)
        {
            string port = "COM3";
            int baudrate = 115200;
            foreach (string arg in args)
            {
                if (arg.StartsWith("-p"))
                {
                    port = arg.Substring(2);
                }
                if (arg.StartsWith("-b"))
                {
                    baudrate = int.Parse(arg.Substring(2));
                }
            }
            SerialHelper serial = new SerialHelper(port,baudrate);
            serial.Start();
            while (true)
            {
                ConsoleKeyInfo a = Console.ReadKey(true);
                serial.Write(a.KeyChar);
            }
        }
    }
}
